﻿namespace Framework
{
    public enum ResStorageType
    {
        Local, Remote
    }

    public static class ResStorageTypeUtil
    {
        private const string _HttpPrefix = "http://";
        private const string _HttpsPrefix = "https://";
        
        public static bool IsHttpUrl(string url)
        {
            return url.StartsWith(_HttpPrefix) || url.StartsWith(_HttpsPrefix);
        }
        
        public static ResStorageType GetResStorageType(string url)
        {
            if (IsHttpUrl(url) || IsHttpUrl(url))
            {
                return ResStorageType.Remote;
            }
            return ResStorageType.Local;
        }
    }
}